package com.qs.questionnairesurveysystem.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;



//CREATE TABLE survey (
//    surveyId BIGINT AUTO_INCREMENT PRIMARY KEY,           -- 问卷唯一标识符，自增
//    amount DECIMAL(10, 2),                                  -- 问卷价值，保留两位小数
//    quantity INT,                                           -- 问卷数量
//    unitPrice DECIMAL(10, 2),                              -- 单价，保留两位小数
//    totalDiscountPrice DECIMAL(10, 2),                    -- 总价（折扣价），保留两位小数
//    title VARCHAR(255) NOT NULL,                            -- 问卷标题，不能为空
//    `condition` TEXT,                                         -- 问卷的甄别条件
//    content TEXT,                                           -- 问卷内容
//    creatorId BIGINT,                                      -- 创建者ID，外键指向管理员或用户
//    creatorType varchar(255),                                      -- 创建者类型，外键指向user或admin
//    participantCount INT DEFAULT 0,                        -- 参与人数，默认0
//    createTime DATETIME,                                   -- 问卷创建时间
//    endTime DATETIME,                                      -- 问卷结束时间
//    status VARCHAR(50),                                     -- 问卷状态
//    description TEXT                                        -- 问卷描述信息
//);



@Data
public class Survey {

    @ApiModelProperty(value = "The unique identifier of the survey", example = "1")
    private Long surveyId;

    @ApiModelProperty(value = "The original price of the survey", example = "100.0")
    private BigDecimal amount;

    @ApiModelProperty(value = "The quantity of the survey", example = "50")
    private Integer quantity;

    @ApiModelProperty(value = "The unit price of the survey", example = "2.0")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "The total discount price of the survey", example = "90.0")
    private BigDecimal totalDiscountPrice;

    @ApiModelProperty(value = "The title of the survey", example = "Customer Satisfaction Survey")
    private String title;

    @ApiModelProperty(value = "The conditions or criteria for the survey", example = "Only open to registered users")
    private String condition;

    @ApiModelProperty(value = "The content of the survey", example = "Please provide your feedback on our services.")
    private String content;

    @ApiModelProperty(value = "The ID of the survey creator", example = "123")
    private Long creatorId;

    @ApiModelProperty(value = "The number of participants in the survey", example = "200")
    private Integer participantCount = 0; // Default value set to 0

    @ApiModelProperty(value = "The creation date and time of the survey", example = "2024-11-06T10:00:00")
    private LocalDateTime createTime;

    private String createType;

    @ApiModelProperty(value = "The end date and time of the survey", example = "2024-11-20T18:00:00")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "The status of the survey", example = "Active")
    private String status;

    @ApiModelProperty(value = "A description or additional information about the survey", example = "This survey aims to gather feedback on the recent product launch.")
    private String description;

    private Long writeCount;

    public Survey() {
        this.createTime = LocalDateTime.now();
    }
}
